#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->move(500,500);
//    QPushButton* qpb = new QPushButton(this);
    qpb = new QPushButton(this);
    qpb->setText("hello world");
    qpb->move(100,200);
    connect(qpb,&QPushButton::clicked,this,&Widget::HeaderClick);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::HeaderClick()
{
    if(qpb->text() == "hello world")
        qpb->setText("hello qt");
    else
        qpb->setText("hello world");
}

